package com.example.demo.behavior.observer;

import java.util.Observer;

/**
 * @Desc:
 * @Author zzz
 * @Date 2021/2/24
 * @Version V1.0
 */
public class ObserverTest {

    public static void main(String[] args) {
        Movie movie = new Movie("唐探三");
        Observer zs = new ZhangSan();
        Observer ls = new LiSi();
        movie.follow(zs);
        movie.follow(ls);

        movie.info();
        movie.publish();
        movie.unfollow(zs);
        System.out.println("张三看完发现很无聊，取关了");
        movie.info();
        movie.publish();
    }

}
